<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 1、数据解构
        let arr = [1,2,3];

        //分别将1,2,3赋值给了x,y,z
        let [x,y,z] = arr;
        console.log(x,y,z);//1 2 3

        //2、对象解构
        const person = {
            "name":"解构表达式",
            "age":9999,
            "language":['java','python','js','css']
        }

        //同样将对象当中的属性值复制给了指定属性名，但是可以给输出的属性名起别名，语法 属性名:别名 即可
        const {name:extName,age,language} = person;
        console.log(extName,age,language);//解构表达式 9999 Array(4)...
    </script>
</body>
</html>